<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>for标签</title>
</head>
<body>
<ul>
    {% for city in lst %}
        {% if forloop.first  %}
        <li>first_list</li>
        {% endif %}
    <li>{{ forloop.counter }}、{{ city }}</li>
        {% if forloop.last  %}
        <li>last_list</li>
        {% endif %}
    {% empty %}
    <li>没有城市</li>
    {% endfor %}
</ul>
</body>
</html>